package com.dhc.appbusinessfrm.ioc.network;

import com.dhc.appbusinessfrm.network.DanluNetInterface;
import com.dhc.appbusinessfrm.network.JsonRequestInterceptor;
import com.dhc.appbusinessfrm.network.MallErrorHandler;
import com.dhc.appbusinessfrm.network.NetAdapterWrapper;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import retrofit.ErrorHandler;
import retrofit.RequestInterceptor;

/**
 * Created by xy on 2015/5/20.
 */
@Module(library = true, complete = false)
public class NetModule {

    /**
     * webservices api url 正式环境
     */
    private static final String API_URL_ZS = "http://app.danlu.com";

    /**
     * webservices api url UAT环境
     */
    private static final String API_URL_UAT = "http://123.57.75.167:8100/mallws";

    /**
     * webservices api url 测试环境
     */
    private static final String API_URL_TEST = "http://172.16.63.223:8080/mallws";

    @Provides
    @Singleton
    DanluNetInterface provideDanluNetInterface() {
        NetAdapterWrapper netAdapterWrapper = new NetAdapterWrapper(API_URL_TEST);
        return netAdapterWrapper.getRestAdapter().create(DanluNetInterface.class);
    }
}
